<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>${o.title }--${site.name }</title>
		<meta name="description" content="${site.description }" />
		<meta name="keywords" content="${site.keywords}" />
		<jsp:include page="../../../inc/css.jsp"></jsp:include>
		<jsp:include page="../../../inc/js.jsp"></jsp:include>
		<script type="text/javascript">
$(function() {
		$("#del").button().click(function(){
			if(confirm('确定删除？'))
			$.ajax( {
				type : "post",
				url : "deleteMsg.do",
				data : {
					id:'${param.id}'
				},
				error : function() {
					alert("加载错误");
				},
				dataType:'json',
				success : function(data) {
					if(data.success){
						alert('操作成功！');
						window.close();
					}else alert("操作失败！"+data.err);
				}
			});
		});
		$("#fix").button().click(function(){
			if(confirm('确定<c:if test="${o.fix>0}">取消</c:if>推荐？'))
			$.ajax( {
				type : "post",
				url : "fixMsg.do<c:if test="${o.fix>0}">?fix=0</c:if>",
				data : {
					id:'${param.id}'
				},
				dataType:'json',
				error : function() {
					alert("加载错误");
				},
				success : function(data) {
					if(data.success){
						alert('操作成功！');
					}else alert("操作失败！"+data.err);
				}
			});
		});
	});
</script>
	</head>
	<body>
		<jsp:include page="../../../head.jsp"></jsp:include>
		<div class="container">
			<div class="header"></div>
			<div class="mainContent">
				<div class="content">
					<table class="msg">
						<tr>
							<td colspan="2">
								<h1 class="title">
									${o.title }
								</h1>
								<!-- 
								<div style="float: right">
									<c:if test="${admin!=null}">
										<button id="del">
											删除
										</button>
										<button id="fix">
											<c:if test="${o.fix>0}">取消</c:if>
											推荐
										</button>
									</c:if>
								</div> -->
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<p>
									${o.description}
								</p>
								<br />
							</td>
						</tr>
						<tr>
							<td width="80">
								联系人：
							</td>
							<td>
								${o.contact }
							</td>
						</tr>
						<tr>
							<td>
								电话：
							</td>
							<td>
								${o.tel }
							</td>
						</tr>
						<tr>
							<td>
								邮箱地址：
							</td>
							<td>
								${o.email }
							</td>
						</tr>
						<tr>
							<td>
								QQ：
							</td>
							<td>
								${o.qq }
							</td>
						</tr>
						<tr>
							<td>
								网站地址：
							</td>
							<td>
								${o.website}
							</td>
						</tr>
						<tr>
							<td>
								有效期：
							</td>
							<td>
								<fmt:formatDate value="${o.enddate}" pattern="yyyy年MM月dd日" />
							</td>
						</tr>
						<tr>
							<td>
								浏览次数：
							</td>
							<td>
								${o.views }
							</td>
						</tr>

					</table>
					<jsp:include page="../msg/msgReply.jsp">
						<jsp:param value="j_msg" name="tableName" />
						<jsp:param value="${o.id}" name="pid" />
					</jsp:include>
				</div>
				<div class="sidebar"><jsp:include
						page="../../../inc/searchMsg.jsp" /></div>
			</div>
		</div>
		<jsp:include page="../../../foot.jsp"></jsp:include>
	</body>
</html>